package com.mike.dao.impl;

import java.util.List;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.stereotype.Repository;

import com.mike.dao.BaseDao;
import com.mike.dao.empintroDao;
import com.mike.pojo.EmpIntro;



@Repository
public class empintroDaoImpl extends BaseDao implements empintroDao{

	public List<EmpIntro> queryei(int empno){
		Session session = getSession();
		String sql ="SELECT e.empno,e.name,e.sal,e.intro,d.deptname FROM t_emp e INNER JOIN t_dept d ON e.intro=d.deptno AND e.empno=?";
		List<EmpIntro> list = session.createSQLQuery(sql).addEntity(EmpIntro.class).setParameter(0, empno).list();
	
		
		
		session.close();
		return list;
	}
}
